package com.magic.gre.mvp.model;

import com.magic.gre.Api;
import com.magic.gre.mvp.contract.HomeContract;
import com.noname.lib_base_java.mvp.BaseModelImpl;
import com.noname.lib_base_java.net.RtManager;

import io.reactivex.Observable;
import io.reactivex.Observer;
import okhttp3.ResponseBody;

/**
 * Author: Lmoumou
 * Date: 2019-01-07 15:26
 * 文件名: HomeModelImpl
 * 描述:
 */
public class HomeModelImpl extends BaseModelImpl implements HomeContract.Model {
    @Override
    public void mBannerData(Observer<ResponseBody> observer) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).bannerList();
        doHttp(observer, observable);
    }

    @Override
    public void mOption(Observer<ResponseBody> observer) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).getOption();
        doHttp(observer, observable);
    }

    @Override
    public void mThesaurusList(Observer<ResponseBody> observer) {
        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).thesaurusList();
        doHttp(observer,observable);
    }
}
